﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.events.*;
    import flash.display.*;
    import flash.utils.*;
    import org.aswing.*;
    import flash.text.*;
    import org.aswing.border.*;
    import Display.aswingui.*;

    public class CharacterDialogView extends GenericDialogView {

        protected var m_customButtonText:String;
        protected var m_formatParams:Object;

        public function CharacterDialogView(_arg1:Dictionary, _arg2:Object, _arg3:String="", _arg4:String="", _arg5:int=0, _arg6:Function=null, _arg7:String="", _arg8:int=0, _arg9:String="Okay"){
            this.m_customButtonText = _arg9;
            this.m_formatParams = _arg2;
            super(_arg1, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
            m_messagePaddingLeft = (_arg2["messagePaddingLeft"]) ? _arg2["messagePaddingLeft"] : -7;
            m_messagePaddingRight = (_arg2["messagePaddingRight"]) ? _arg2["messagePaddingRight"] : 0;
            m_titleFontSize = (_arg2["titleFontSize"]) ? _arg2["titleFontSize"] : 14;
            m_titleSmallCapsFontSize = (_arg2["titleSmallCapsFontSize"]) ? _arg2["titleSmallCapsFontSize"] : 22;
            m_align = (_arg2["align"]) ? _arg2["align"] : TextFormatAlign.LEFT;
            conditionalRebuildCenterPanel();
        }
        override protected function createInteriorHolder():JPanel{
            var _local1:JPanel;
            var _local3:JPanel;
            var _local8:JPanel;
            _local1 = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, -20, SoftBoxLayout.TOP));
            _local1.setPreferredWidth(m_bgAsset.width);
            _local1.setMinimumWidth(m_bgAsset.width);
            _local1.setMaximumWidth(m_bgAsset.width);
            var _local2:JPanel = createHeaderPanel();
            ASwingHelper.prepare(_local2);
            _local3 = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, 0);
            var _local4:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.BOTTOM);
            var _local5:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.BOTTOM);
            var _local6:DisplayObject = m_assetDict["character"];
            var _local7:AssetPane = new AssetPane(_local6);
            ASwingHelper.setSizedBackground(_local5, _local6);
            _local4.append(_local5);
            ASwingHelper.setEasyBorder(_local4, 0, 0);
            textArea = createTextArea();
            ASwingHelper.prepare(textArea);
            _local3.appendAll(_local4, textArea);
            _local1.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 0)));
            _local1.append(_local2);
            _local1.append(ASwingHelper.verticalStrut(35));
            _local1.append(_local3);
            _local3.mouseChildren = (_local3.mouseEnabled = false);
            if (m_type != TYPE_MODAL){
                _local8 = this.createButtonPanel();
                _local1.append(_local8);
            };
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        override protected function setMessageTextWidth(_arg1:Boolean=false):Number{
            return (270);
        }
        override protected function createButtonPanel():JPanel{
            m_acceptTextName = ZLoc.t("Dialogs", this.m_customButtonText);
            var _local1:JPanel = new JPanel(new FlowLayout(AsWingConstants.CENTER));
            var _local2:CustomButton = new CustomButton(m_acceptTextName, null, "GreenButtonUI");
            _local2.addActionListener(onAccept, 0, true);
            _local1.append(_local2);
            return (_local1);
        }
        override protected function createCloseButtonPanel():JPanel{
            var _local1:JPanel = new JPanel(ASwingHelper.softBoxLayoutVertical);
            var _local2:JButton = ASwingHelper.makeMarketCloseButton();
            _local2.addEventListener(MouseEvent.CLICK, onCancelX, false, 0, true);
            _local1.append(_local2);
            ASwingHelper.setEasyBorder(_local2, 4, 0, 0, 4);
            return (_local1);
        }

    }
}//package Display.DialogUI 
